        <?php        
session_start();      
include_once 'data_access.php';
include_once 'student.php';
$connect=new database_access();
$connect->connect();
$student=new student();
$recommendation=$student->showrecomendation($_SESSION['personalnumber']);
$row=mysql_fetch_array($recommendation);
$room_id=$row['room_id'];
$buildingnum=$student->buildingnum($_SESSION['personalnumber']);
$studentnum=$student->selectstudentinroom($room_id, $buildingnum);
$num_ros=mysql_num_rows($studentnum);
if($num_ros >=3){
    $student->rejectrecomendation($room_id,$_SESSION['personalnumber']);
    header('location: sorrynotcomplitrec.php');
}
 else {
$student->updateroom($room_id,$_SESSION['personalnumber']);
  $student->rejectrecomendation($room_id,$_SESSION['personalnumber']);
header('location: accepted.php');    
}
?>